package com.android.flowoflife.services;

import java.util.Timer;
import java.util.TimerTask;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class ShootService extends Service {
	private static final String TAG = "Shoot_Service"; 
	private Timer timer = new Timer();
	private static final int INTERVAL = 3000;

	@Override
	public void onCreate() {
		super.onCreate();
		_startService();
	}

	public void _startService(){
		timer.scheduleAtFixedRate(new TimerTask(){

			@Override
			public void run() {
				Log.v(TAG, "Shooting from service");
			}
			
		}, 0, INTERVAL);
	}
	@Override
	public void onStart(Intent intent, int startId) {
		// TODO Auto-generated method stub
		super.onStart(intent, startId);
	}

	@Override
	public void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
		if(timer != null) timer.cancel();
		Log.v(TAG, "Destroying the service");
	}

	@Override
	public IBinder onBind(Intent intent) {
		// TODO Auto-generated method stub
		return null;
	}

}
